From: Seif Lotfy Date: Fri, 19 Oct 2012 11:55:18 +0000 (+0200) Subject: workspacesView: Don't show workspace switcher when it doesn't make sense X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5574 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=78f6dec73b087b0a69ceec1b9d928915d2279bb9;p=gnome-shell.git workspacesView: Don't show workspace switcher when it doesn't make sense Hide workspace switcher if dynamic workspaces is disabled and number of workspaces is set to one only, since the user is bound to only one workspace and showing the switcher is redundant. Signed-off-by: Seif Lotfy --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index edb636b09..3832efaef 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -541,6 +541,16 @@ const WorkspacesDisplay = new Lang.Class({ this._notifyOpacityId = 0; this._swipeScrollBeginId = 0; this._swipeScrollEndId = 0; + + this._settings = new Gio.Settings({ schema: OVERRIDE_SCHEMA }); + this._settings.connect('changed::dynamic-workspaces', + Lang.bind(this, this._updateSwitcherVisibility)); + }, + + _updateSwitcherVisibility: function() { + this._thumbnailsBox.actor.visible = + this._settings.get_boolean('dynamic-workspaces') || + global.screen.n_workspaces > 1; }, show: function() { @@ -563,6 +573,7 @@ const WorkspacesDisplay = new Lang.Class({ this._controls.show(); this._thumbnailsBox.show(); + this._updateSwitcherVisibility(); this._updateWorkspacesViews(); @@ -974,6 +985,7 @@ const WorkspacesDisplay = new Lang.Class({ for (let i = 0; i < this._workspacesViews.length; i++) this._workspacesViews[i].updateWorkspaces(oldNumWorkspaces, newNumWorkspaces); + this._updateSwitcherVisibility(); }, _updateZoom : function() {